<?php
/* @var $this PageMasterController */
/* @var $model PageMaster */

$this->breadcrumbs=array(
	'Page Masters'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'Create Page', 'url'=>array('create')),
	array('label'=>'Manage Page', 'url'=>array('admin')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#page-master-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h3>Manage Page Masters</h3>

<?php // echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id'=>'page-master-grid',
	'type'=>'striped bordered condensed hover',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'page_name',
		array(
		'name' => 'template',
		'value'=>'ApplicationConfig::app()->params["scaling_params"]["page_template"][$data->template]'
		),
		'created_date',
		array(
		'name'=>'status',
		'value' => 'ApplicationConfig::app()->params["scaling_params"]["status"][$data->status]',
		'filter'=> ApplicationConfig::app()->params["scaling_params"]["status"]
		),
	
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'template'=>'{update}{delete}{manage}',
			'buttons'=>array
		    (
		        'manage' => array
		        (
		            'url'=>'Yii::app()->createUrl("/pageLocationMapping/admin", array("id"=>$data->page_id))',
		        	 'options'=>array(
			                'id'=>'$data->page_id',
			            ),
			        'imageUrl'=>ApplicationConfig::app()->params["theme"]["imageUrl"]."menuitem.png", 
			        'label' =>'Manage Page Locations'    
		        ),
		       
    		),
		),
	),
)); ?>
